<?php

namespace app\common\service;




use app\api\service\User;
use think\Exception;

class Buy
{
    public function checkMobile(): bool
    {
        try {
            $user_id = User::getCurrentLoginUserId();
            $condition = [
                ['is_delete','=',0],
                ['user_id','=',$user_id],
            ];
            $user = \app\common\model\User::where($condition)->find();
            if($user->mobile == ''){
                throw new Exception('手机号未绑定');
            }
            return true;
        }catch (\Exception $exception){
            throwError($exception->getMessage());
        }
    }
}